Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Manual Search] Log multi-epi as snatched #240

Merged
merged 2 commits into from
Apr 1, 2016
Merged

Conversation

fernandog
Copy link
Contributor

Fixes #229

@fernandog fernandog force-pushed the multiep_manualsearch branch 7 times, most recently from 8329425 to 966803c Compare March 31, 2016 00:17
@fernandog
Copy link
Contributor Author

why Im getting when I pick a result in snatchSelection.mako:

 File "/home/osmc/SickRage/sickbeard/webserve.py", line 1425, in pickManualSnatch
        search_result = SearchResult(provider=provider, show=show_obj, url=sql_return['url'], episodes=ep_objs, quality=sql_return['quality'], name=sql_return['name'], size=sql_return['size'], seeders=sql_return['seeders'], leechers=sql_return['leechers'], release_group=sql_return['release_group'], version=sql_return['version'])
TypeError: __init__() got an unexpected keyword argument 'seeders'

if searchResult has seeders?

https://github.com/pymedusa/SickRage/blob/develop/sickbeard/classes.py#L35-L65

@labrys
Copy link
Contributor

labrys commented Mar 31, 2016

It's because SearchResult's __init__ only takes episodes as a parameter. You need to modify the __init__ to accept other arguments, or create the object without it and access the created objects' attributes to set the values.

@fernandog fernandog force-pushed the multiep_manualsearch branch 12 times, most recently from 1924c0e to 50850c8 Compare March 31, 2016 12:28
@fernandog fernandog changed the title [Manual Search] [WIP] Log multi-epi as snatched [Manual Search] Log multi-epi as snatched Mar 31, 2016
@fernandog fernandog force-pushed the multiep_manualsearch branch 5 times, most recently from e41b8af to 0341929 Compare March 31, 2016 12:56
@@ -125,26 +125,27 @@ def collectEpisodesFromSearchThread(show):
# Queued Searches
searchstatus = SEARCH_STATUS_QUEUED
for searchThread in sickbeard.searchQueueScheduler.action.get_all_ep_from_queue(show):
episodes += getEpisodes(searchThread, searchstatus)
if isinstance(searchThread, sickbeard.search_queue.ManualSearchQueueItem):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are you checking this? get_all_ep_from_queue() only returns ManualSearchQueueItem. So now your validating redundant?

searchstatus = SEARCH_STATUS_FINISHED

episodes += getEpisodes(searchThread, searchstatus)
if isinstance(searchThread, sickbeard.search_queue.ManualSearchQueueItem):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@fernandog fernandog force-pushed the multiep_manualsearch branch 4 times, most recently from b74c047 to ccb1e79 Compare March 31, 2016 13:39
@p0psicles
Copy link
Contributor

Really @fernandog, I don't get it. You ask me for help? But in the mean time your doing all kinds of "fixups" that are just wrong. I'm done with this PR.

search_result.leechers = int(sql_return['leechers'])
search_result.release_group = sql_return['release_group']
search_result.version = int(sql_return['version'])
search_result.resultType = search_result.provider.provider_type
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@p0psicles is this still ok?

@fernandog
Copy link
Contributor Author

@labrys @OmgImAlexis @p0psicles need aprove

@duramato
Copy link
Contributor

Can say this fixes it, and works ofc lol

@fernandog
Copy link
Contributor Author

@p0psicles
to handle Season Packs i think we should do something similar to this. But I didn't understood the logic
https://github.com/pymedusa/SickRage/blob/develop/sickrage/providers/GenericProvider.py#L288-L317

lets leave this to other PR (Season pack support) so in this next one we add 'season search'. Something like this:

@pymedusa/developers

  • First icon will do a forced search for season packs only and pick the best (only if all episodes are already aired).
    It should do:
    window.location.href = srRoot + '/home/setStatus?show=' + $('#showID').attr('value') + '&eps=' + GET_ALL_EPS_FROM_SEASON + '&status=3; 3 = WANTED
    maybe popup asking user if he really wants season search because all episodes will be set to WANTED
  • Second icon will show only season packs results and user pick one (only if all episodes are already aired)
    It should call:
    snatchSelection?show=00000&season=1&perform_search=0 without episode

Ideas? Agree? Disagree?

image

@p0psicles
Copy link
Contributor

@fernandog, I agree. Tough we really need to create a better looking snatch selection icon.

Ps. Could you make sure this get's merged, before merging this into dev? #245

@fernandog fernandog merged commit 7d5a022 into develop Apr 1, 2016
medariox pushed a commit that referenced this pull request Apr 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants